"use strict";

var C = require('../lib/common');

module.exports = function (engine, attributes, content, next) {

    var dbKey = engine.parseValue(attributes.db);

    C.H.connectDb(dbKey, function (err, db) {
        if (err) throw err;

        db.dropDatabase(function(err) {
            if (err) throw err;

            console.log('Dropped database: ' + dbKey);

            setTimeout(next, 1000);
        });
    });
};